package dfbz.demo.homework4;

public class TEST {
    public static void main(String[] args) {
        Worker worker=new Worker();
        Apple apple1=new Apple(5,"青色");
        Apple apple2=new Apple(3,"红色");
       worker.chooseApple(new CompareAble() {
           @Override
           public Apple compare(Apple a1, Apple a2) {
               if(a1.getColor().equals("红色")){
                   return a1;
               }else if(a2.getColor().equals("红色")){
                   return a2;
               }
               return new Apple();
           }
       },apple1,apple2);
       Apple apple=worker.chooseApple(new CompareAble() {
       },apple1,apple2);
       apple1.show();
        System.out.println("挑选红色的:");
       apple2.show();
    }
}
